package com.xz;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @Author：xz
 * @Date：2023/3/28
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode// 用于后期去重使用
public class Author implements Comparable<Author> {

    private Long id;

    private String name;

    private Integer age;
    // 简介
    private String intro;
    // 作品
    private List<Book> books;


    @Override
    public int compareTo(Author o) {
        return o.getAge() - this.getAge();
    }
}
